<?php
	require_once '../lib/controller.php';

	class action extends controller
	{
		var $db = '';
		var $data = '';

		public function do_get()
		{
			$member = $this->module('biz.member');
			$data = $member->get_user_info();
			$this->view('www.info' , $data);
		}

		public function do_post()
		{
			$member = $this->module('biz.member');
			if( $member->update_user_info( array('nick'=>$this->post['nick'] ) ) )
			{
				$this->msg($member->msg, 3, 'info.php');
			}
			else
			{
				$this->msg($member->msg);
			}
		}

		function check_privileges()
		{
			if( ! isset($this->session['user_id']) )
			{
				$this->msg('请先登录', 3, 'login.php');
				return false;
			}
			else
			{
				return true;
			}
		}

		public function check_post()
		{
			return true;
		}
	}

	$action = new action();
	$action->run();
?>